import { defHttp } from '/@/utils/http/axios';
import {
  IPostConfigsQueryQuery,
  IPostConfigsQueryResponse,
} from '/@/types/system/senior/configs/query';
import { IGetRawConfigsDetailsResponse } from '/@/types/system/senior/configs/details';
import { IPostConfigsUpdateRaw } from '/@/types/system/senior/configs/update';

/**
 * 刷新配置缓存
 */
export const apiDeleteConfigsCache = () => defHttp.delete({ url: `/system/senior/configs/cache` });
/**
 * 参数列表
 */
export const apiPostConfigsQueryQuery = (params: IPostConfigsQueryQuery) =>
  defHttp.post<IPostConfigsQueryResponse>({ url: `/system/senior/configs/query`, params });
/**
 * 配置信息
 */
export const apiGetConfigsDetailsPath = (configId: string | number) =>
  defHttp.get<IGetRawConfigsDetailsResponse>({ url: `/system/senior/configs/details/${configId}` });
/**
 * 配置修改
 */
export const apiPostConfigsUpdatePath = (
  configId: string | number,
  params: IPostConfigsUpdateRaw,
) => defHttp.post({ url: `/system/senior/configs/update/${configId}`, params });
